﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hydra.Shell.Implementations;
using TestPackageProjection.Entities;
using Hydra.Shell.ProjectionAttributes;

namespace TestPackageProjection
{
    public class MyCustomerPackage : HydraPackage
    {
        [Association]
        public List<Customer> Customers { get; private set;  } 

        public MyCustomerPackage() 
        {
            Customers = new List<Customer>()  
            { 
                new Customer 
                { 
                    ID = Guid.NewGuid().ToString(),
                    Name = "Joe",
                    Orders = new List<Order>()
                    {
                        new Order
                        {
                            ID = Guid.NewGuid().ToString(),
                            OrderNumber = 1,
                            Products = new List<Product>()
                            {
                                new Product
                                {
                                    ID = Guid.NewGuid().ToString(),
                                    Name = "Soap"
                                },
                                new Product
                                {
                                    ID = Guid.NewGuid().ToString(),
                                    Name = "Shaving Cream"
                                }
                            }
                        },
                        new Order
                        {
                            ID = Guid.NewGuid().ToString(),
                            OrderNumber = 2,
                            Products = new List<Product>()
                            {
                                new Product
                                {
                                    ID = Guid.NewGuid().ToString(),
                                    Name = "Toothbrush"
                                },
                                new Product
                                {
                                    ID = Guid.NewGuid().ToString(),
                                    Name = "Comb"
                                }
                            }
                        },
                    }
                }, 
                new Customer 
                { 
                    ID = Guid.NewGuid().ToString(),
                    Name = "Bob",
                    Orders = new List<Order>()
                    {
                        new Order
                        {
                            ID = Guid.NewGuid().ToString(),
                            OrderNumber = 3,
                            Products = new List<Product>()
                            {
                                new Product
                                {
                                    ID = Guid.NewGuid().ToString(),
                                    Name = "Bananas"
                                },
                                new Product
                                {
                                    ID = Guid.NewGuid().ToString(),
                                    Name = "Strawberries"
                                },
                                new Product
                                {
                                    Name = "Bread"
                                }                            
                            }
                        },
                        new Order
                        {
                            ID = Guid.NewGuid().ToString(),
                            OrderNumber = 4,
                            Products = new List<Product>()
                            {
                                new Product
                                {
                                    ID = Guid.NewGuid().ToString(),
                                    Name = "Beer"
                                },
                                new Product
                                {
                                    ID = Guid.NewGuid().ToString(),
                                    Name = "Ice"
                                }
                            }
                        },
                        new Order
                        {
                            ID = Guid.NewGuid().ToString(),
                            OrderNumber = 4,
                            Products = new List<Product>()
                            {
                                new Product
                                {
                                    ID = Guid.NewGuid().ToString(),
                                    Name = "Aspirin"
                                }
                            }
                        },                    
                    }
                } 
            };
        }
    }
}
